<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        .box{
            width: 200px;
            height: 200px;
            background-color: gold;
            text-align: center;
            line-height: 200px;
        }
        /* 让一张图片垂直居中：父中写 line-height=height; 子中写vertical-align: middle; */
        .son{
            /* vertical-align设置垂直对齐 */
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <div class="box">
        <img width="100px" class="son" src="./images/02.webp" alt="">
    </div>
</body>
</html>